<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <title>忘记密码</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta name="Keywords" content="sofangche" />
    <!-- 引入Bootstrap框架 -->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pcsofangche/common/bootstrap/css/bootstrap.min.css" />
    <script src="${pageContext.request.contextPath}/static/pcsofangche/common/bootstrap/jquery/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/static/pcsofangche/common/bootstrap/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>

    <!-- 引入全局css -->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pcsofangche/common/allcss/stander.css" />
    <!-- 引入全局js -->
    <script src="${pageContext.request.contextPath}/static/pcsofangche/common/alljs/stander.js" type="text/javascript" charset="utf-8"></script>
    <!-- 引入页面css -->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pcsofangche/user/forget/forget.css" />
    <!-- 引入页面js -->
    <script src="${pageContext.request.contextPath}/static/pcsofangche/user/forget/forget.js" type="text/javascript" charset="utf-8"></script>

</head>
<body>
<jsp:include page="../../common/allhead/allhead.jsp" flush="true"/>
<div class="container">
    <div class="row back">
        <div class="col-lg-2 col-md-2"></div>
        <div class="col-lg-8 col-md-8 kuang">
            <div class="row first">
                <div class="forget">忘记密码</div>
                <div class="col-md-8 col-md-offset-2">
                <div class="account">
                    账&nbsp;&nbsp;&nbsp;&nbsp;号：
                    <div class="phone">
                        <input type="text" placeholder="请输入中国大陆手机号" style="color:grey;width: 330px;height: 40px;" id="phone" />
                    </div>
                </div>
                <div class="password">
                    验证码：
                    <div class="vcode">
                        <input type="text" placeholder="请输入右边图片验证码" style="color:grey;width: 220px;height: 40px;" id="vcode"/>
                        <div class="vcodeimg">
                            <img src="/meb/codeimg" id="vcodeimg" style="height: 40px;width:110px" onclick="changevcode()">
                        </div>
                    </div>
                </div>
                    <div class="pcode">
                        <input type="text" placeholder="手机验证码" id="pcode" style="color:grey;width: 220px;height: 40px; display: inline"/>
                        <div class="sendpcode" onclick="sendcode()"><span>发送验证码</span></div>
                    </div>


                    <div class="next" onclick="next()">
                    下一步
                </div>
                </div>
            </div>
        </div>
        <div class="col-lg-2 col-md-2"></div>
    </div>
</div>
<jsp:include page="../../common/allfoot/allfoot.jsp" flush="true"/>
</body>
<script>
    $(document).ready(function(){
    });

    //点击验证码切换
    function changevcode(){
        console.log("123")
        let random=Math.random()
        console.log(random);
        $("#vcodeimg").attr('src','/meb/codeimg?'+random);
    }

    //验证码失焦检测是否正确
    $("#vcode").blur(function(){

        let vcode=$("#vcode").val();
        console.log(vcode)
        $.ajax({
            url:'http:/meb/checkcode',
            data:{
                code:vcode
            },
            type:'post',
            dataType:'json',
            success:function(data){
                vcheck=data.code;
                if(data.code=="2"){
                    console.log("xxxx")
                    $("#vcodewaring").css('display','block');
                }
                if(data.code=="1"){
                    $("#vcodewaring").css('display','none');
                }
            },
            error:function(data){

            },
            complete:function (data) {

            }
        })

    });
    function sendcode() {
        console.log("执行sendcode")
        let phone=$("#phone").val();
        console.log(phone)
        $.ajax({
            url:'http:/meb/phonecode',
            data:{
                phone:phone
            },
            type:'post',
            dataType:'json',
            success:function(data){
                console.log(data)
            },
            error:function(data){

            },
            complete:function (data) {

            }
        })
    }

    function next() {
        点击验证信息，跳转到下一个页面FORGET2,接口没找到
    }
</script>
</html>
